import http from '@/utils/request'
const URL = '/breed/dovecoteOutBill';

//按基地id、鸽棚编号、类型分页查询肉鸽出库订单
export function getAllInfoByPage(pageNum = 1, pageSize = 10,data) {
    return http({
        url:`${URL}/findBillByDovecoteAndType?baseId=${data.baseId}&dovecoteNumber=${data.dovecoteNumber}&type=${data.type}&pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'get',
    })
}

//根据日期查鸽棚
export function getByDateInfo(data) {
    return http({
        url:`${URL}/getDovecoteOutBillByDate?baseId=${data.baseId}&type=${data.type}&date=${data.date}`,
        method: 'get',
    })
}

//添加订单
export function AddOrder(data) {
    return http({
        url:`${URL}/submitDovecoteOutBill`,
        method: 'post',
        data
    })
}

//添加种鸽入库订单
export function AddStorage(data) {
    return http({
        url:`/breed/shipmentEntryBill/submitShipmentEntryBill`,
        method: 'post',
        data
    })
}

//通过type查询订单详细
export function getInfoByType(data) {
    return http({
        url: `/breed/dovecoteOutBase/get`,
        method: 'post',
        data
    })
}

//通过id删除订单
export function deleteOrder(id) {
    return http({
    url: `${URL}/delete/${id}`,
    method:'get'
  })
}

//通过批次号查询数据
export function getInfoByBatch(data) {
    return http({
        url: `${URL}/getDovecoteOutBillByFarmBatch?farmBatch=${data.farmBatch}&baseId=${data.baseId}&type=${data.type}`,
        method:'get'
    })
}

//通过id修改订单
export function editOrder(billId,data) {
    return http({
        url: `${URL}/update?billId=${billId}`,
        method: 'post',
        data
    })
}

//查询日结
export function getDayInfo(data) {
    return http({
        url: `${URL}/getSumOfDayByBaseIdAndType?baseId=${data.baseId}&type=${data.type}`,
        method: 'get',
    })
}

export function getInfo(params) {
    return http({
        url: `/breed/shipmentOutBill/getShipmentOutBillByDate`,
        method: 'get',
        params
    })
}

//日结
export function AmountByDate(params) {
    return http({
        url: `/breed/shipmentOutBill/getKindOfMeetDoveAmountByDate`,
        method: 'get',
        params
    })
}
//月结
export function PMonth(params) {
    return http({
        url: `/breed/shipmentOutBill/getMonthly`,
        method: 'get',
        params
    })
}

// //种鸽入库
// export function Storage(params) {
//     return http({
//         url: `/breed/shipmentEntryBill/getAllEntryBillByIdAndType/1/1`,
//         method: 'get',
//         params
//     })
// }

// // 种鸽入库
// export function Storage(pageNum = 1, pageSize = 10,data) {
//     return http({
//         url:`/breed/shipmentEntryBill/getAllEntryBillByIdAndType/${pageNum}/${pageSize}?baseId=${data.baseId}&type=${data.type}`,
//         method: 'get',
//     })
//   }